package demo7;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * Spring管理对象时:单例或多利
 */
public class Demo {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context =
                new AnnotationConfigApplicationContext("demo7");
        DBConn dbConn = context.getBean(DBConn.class);
        System.out.println(dbConn);

        DBConn dbConn1 = context.getBean(DBConn.class);
        System.out.println(dbConn1);
    }


}
